<%--
    Document   : index
    Created on : 19 juin 2010, 23:51:05
    Author     : marya
--%>

<%@page contentType="text/xml" pageEncoding="UTF-8"%>
<%@page import="org.restlet.resource.ClientResource" %>
<%@page import="org.restlet.representation.Representation" %>
<%@page import="org.restlet.ext.xml.DomRepresentation" %>
<%@page import="org.restlet.data.Method" %>
<%@page import="org.w3c.dom.Element" %>
<%@page import="org.w3c.dom.Node" %>
<%@page import="org.w3c.dom.NodeList" %>
<%@page import="java.util.List" %>
<%@page import="xmlws.helpers.WebService" %>
<%
            request.setCharacterEncoding("UTF-8");
            response.setCharacterEncoding("UTF-8");


            ClientResource client = new ClientResource(WebService.federateur + "/promotions/" + request.getParameter("idPromotion")+"/url");
            DomRepresentation representation = new DomRepresentation(client.get());
            NodeList promotions = representation.getDocument().getChildNodes();
            Node promotion = promotions.item(0);
            String uriPromotion = promotion.getAttributes().getNamedItem("href").getTextContent();
            String nomPromotion = promotion.getFirstChild().getTextContent();




            out.println("<form name=\"form_modifyPromotion\" action=\"#\" accept-charset=\"UTF-8\">");
            out.println("<table>");
            out.println("<tr><td>Nom : </td><td><input type=\"text\" name=\"nomPromotion\" value=\"" + nomPromotion + "\" /></td></tr>");
            out.println("<tr><td>URL : </td><td><input type=\"text\" name=\"uriPromotion\" value=\"" + uriPromotion + "\" /></td></tr>");
            out.println("<tr><td>&nbsp;</td><td><input type=\"button\" class=\"button\" value=\"Enregistrer\" onclick=\"modify_promotion(" + request.getParameter("idPromotion") + ");\"/></td></tr>");
            out.println("</table>");
            out.println("</form>");














%>

